#from django.db import models
from google.appengine.ext import db
from google.appengine.tools.bulkloader  import Loader  

# Create your models here.
class Music(db.Model):
    """
    music storage should not be in the movie app
    but managed in another app
    """
    mname = db.StringProperty()
    jsondesp = db.StringProperty()
    addtime = db.DateTimeProperty(auto_now=False)

class MusicLoad(Loader):
    

class Singer(db.Model):
    """
    the singer(min unit in human)
    """
    sname = db.StringProperty()
    jsondesp = db.StringProperty()

class Album(db.Model):
    """
    the album
    """
    aname = db.StringProperty()
    jsondesp = db.StringProperty()

class Lyricist(db.Model):
    """
    person who write lyric
    """
    lname = db.StringProperty()
    jsondesp = db.StringProperty()

class MusicLyricistLink(db.Model):
    """
    linek between music and lyricist
    """
    music = db.ReferenceProperty(Music)
    lyricist = db.ReferenceProperty(Lyricist)
    jsondesp = db.StringProperty()

class MusicSingerLink(db.Model):
    music = db.ReferenceProperty(Music)
    singer = db.ReferenceProperty(Singer)
    jsondesp = db.StringProperty()

class MusicAlbumLink(db.Model):
    music = db.ReferenceProperty(Music)
    album = db.ReferenceProperty(Album)
    jsondesp = db.StringProperty()

class AlbumSingerLink(db.Model):
    album = db.ReferenceProperty(Album)
    music = db.ReferenceProperty(Music)
    jsondesp = db.StringProperty()
